const Minio = require('minio')

// Instantiate the minio client with the endpoint
// and access keys as shown below.
const minioClient = new Minio.Client({
    endPoint: '59.110.171.148',
    port: 9000,
    useSSL: false,
    accessKey: process.env.minio_accessKey,
    secretKey: process.env.minio_secretKey
});

// // Make a bucket called europetrip.
// minioClient.makeBucket('europetrip', 'us-east-1', function (err) {
//     if (err) return console.log(err)
//
//     console.log('Bucket created successfully in "us-east-1".')
//
//     var metaData = {
//         'Content-Type': 'application/octet-stream',
//         'X-Amz-Meta-Testing': 1234,
//         'example': 5678
//     }
//     // Using fPutObject API upload your file to the bucket europetrip.
//     minioClient.fPutObject('europetrip', 'photos-europe.tar', file, metaData, function (err, etag) {
//         if (err) return console.log(err)
//         console.log('File uploaded successfully.')
//     });
// });

module.exports = minioClient
